package com.example.cash.craft.schedule;

import com.example.cash.craft.service.IProductService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

@Component
public class ProductCacheSchedule {

    @Autowired
    private IProductService productService;

    @Scheduled(fixedRate = 1000 * 60 * 5)
    public void rebuildCache() {
        productService.rebuildCache();
    }

}
